package main

import (
	"fmt"
	"net/url"
	"strings"
)

func main() {
	rawURL := "https://10.8.219.83/PAM-XXS/v1/system/config-backups/download/"

	// 解析URL
	parsedURL, err := url.Parse(rawURL)
	fmt.Println("parsedURL:", parsedURL)
	if err != nil {
		fmt.Println("URL解析出错:", err)
		return
	}

	// 提取主机部分
	host := parsedURL.Scheme + "://" + parsedURL.Host
	fmt.Println("提取的主机地址为:", host)

	protocolRemovedURL := strings.Replace(rawURL, "https://", "", 1)
	fmt.Println("protocolRemovedURL:", protocolRemovedURL)
}
